package cl.zeke.remoto.vista.managedbeans;

import java.io.InputStream;
import java.util.Properties;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 *
 * @author zeke
 */
@Component
@Scope("singleton")
public class VersionBean {

    private String version;

    public String getVersion() throws Exception {
        if (version != null) {
            return version;
        }
        Properties props = new Properties();
        try (InputStream is = VersionBean.class.getResourceAsStream("/version.properties")) {
            props.load(is);
        }
        version = props.getProperty("version");
        return version;
        
    }

}
